<?php
return [
    'aliases' => [
        '@bower' => '@vendor/bower-asset',
        '@npm' => '@vendor/npm-asset',
    ],
    'vendorPath' => dirname(dirname(__DIR__)) . '/vendor',
    'components' => [
        'cache' => [
            'class' => 'yii\caching\FileCache',
        ],
        'log' => [
            'traceLevel' => YII_DEBUG ? 3 : 0,
            'targets' => [
                [
                    'class' => 'yii\log\FileTarget',
                    'levels' => ['error'],
                    'logVars' => [],
                    'logFile' => '@runtime/logs/' . date('Y-m-d') . '/error.txt'
                ],
                //记录所有查询和非查询语句
                [
                    'class' => 'yii\log\FileTarget',
                    'levels' => ['info'],
                    'categories' => [
                        'yii\db\Command::execute',
                        'yii\db\Command::query'
                    ], //查询语句yii\db\Command::query
                    'logVars' => [],
                    'logFile' => '@runtime/logs/' . date('Y-m-d') . '/db.txt'
                ],
                //记录自己的输出方便线上调试，Yii::info('message','my');
                [
                    'class' => 'yii\log\FileTarget',
                    'categories' => ['my'],
                    'logVars' => [],
                    'logFile' => '@runtime/logs/' . date('Y-m-d') . '/my.txt'
                ],
            ]
        ],
    ],
    'language' => 'zh-CN',
];
